<template>
  <div class="box-bpdy box-primary">
    <div class="form-horizontal">
      <div class="box-body">
        <div class="form-group">
          <label class="col-md-3 control-label my-label">数据访问授权名称:</label>
          <div class="col-sm-9">
            <input class="form-control" v-model="editDataPriv.name" placeholder="请输入数据授权名称" v-bind:readonly="isReadOnly">
          </div>
        </div>
        <div class="form-group">
          <label class="col-md-3 control-label my-label">描述:</label>
          <div class="col-sm-9">
            <input class="form-control" v-model="editDataPriv.desc" placeholder="请输入描述信息" v-bind:readonly="isReadOnly">
          </div>
        </div>
        <div class="form-group">
          <label class="col-md-3 control-label my-label">授权组织节点:</label>
          <div class="col-sm-9">
           <combotree ref='tree' :treeData="organizations" :options="options" />
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import RestApi from "../../../common/restapi"
import combotree from '../common/tree/combotree'
export default {
  name: "dataPrivEdit",
  props: ["dataPriv"],
  data() {
    return {
      isReadOnly: false,
      editDataPriv: {
        name: "",
        desc:"",
        dataPrivs: [],
        isDefault: false
      },
      organizations: []
    }
  },
  components: {
    combotree
  },
  created: function() {
    if (this.func) {
      this.editDataPriv = this.dataPriv
    }
    let that = this
    RestApi.getOrganizations(function(data) {
      that.organizations = data.data
    })

  },
  mounted: function() {

  },
  methods: {
  }
}
</script>
